<?php

if(!file_exists(DATA_PATH . "/config/settings.php")) {
	die("System configuration not exists");
}

require(DATA_PATH . "/config/settings.php");
if(!isset($settings['SERVER_ID'])) {
	die("SERVER_ID error");
}
if(!isset($settings['SERVER_KEY'])) {
	die("SERVER_KEY error");
}

if(!isset($settings['SYSTEM_CHARSET'])) {
	die("SYSTEM_CHARSET error");
}
if(!isset($settings['CHAT_SERVER_IP'])) {
	die("CHAT_SERVER_IP error");
}
if(!isset($settings['CHAT_SERVER_PORT'])) {
	die("CHAT_SERVER_PORT error");
}

if(!isset($settings['DB_HOST'])) {
	die("DB_HOST error");
}
if(!isset($settings['DB_USER'])) {
	die("DB_USER error");
}
if(!isset($settings['DB_PASS'])) {
	die("DB_PASS error");
}
if(!isset($settings['DB_NAME'])) {
	die("DB_NAME error");
}
if(!isset($settings['DB_LOG_HOST'])) {
	die("SYSTEM_CHARSET error");
}
if(!isset($settings['DB_LOG_USER'])) {
	die("SYSTEM_CHARSET error");
}
if(!isset($settings['DB_LOG_PASS'])) {
	die("SYSTEM_CHARSET error");
}
if(!isset($settings['DB_LOG_NAME'])) {
	die("SYSTEM_CHARSET error");
}
/*-------------------------------------[ 系统必须配置变量 ]-----------------------------------[ begin ]--*/
define("SYSTEM_CHARSET",$settings['SYSTEM_CHARSET']);
define("SERVER_ID",$settings['SERVER_ID']);
define("SERVER_KEY",$settings['SERVER_KEY']);

define("SERVER_DOMAIN",$settings["SERVER_DOMAIN"]);
define("MAIN_DOMAIN_URL",$settings["MAIN_DOMAIN_URL"]);

define("MEDIA_SERVER_HOST",$settings["MEDIA_SERVER_HOST"]);

define("CHAT_SERVER_IP",$settings['CHAT_SERVER_IP']);
define("CHAT_SERVER_PORT",$settings['CHAT_SERVER_PORT']);
define("CHAT_POLICY",$settings['CHAT_POLICY']);

define("DB_HOST",$settings['DB_HOST']);
define("DB_USER",$settings['DB_USER']);
define("DB_PASS",$settings['DB_PASS']);
define("DB_NAME",$settings['DB_NAME']);

define("DB_LOG_HOST",$settings['DB_LOG_HOST']);
define("DB_LOG_USER",$settings['DB_LOG_USER']);
define("DB_LOG_PASS",$settings['DB_LOG_PASS']);
define("DB_LOG_NAME",$settings['DB_LOG_NAME']);

define("RD_MASTER_HOST",$settings['REDIS_MASTER_HOST']);
define("RD_MASTER_PORT",$settings['REDIS_MASTER_PORT']);
define("RD_SLAVE_HOST",$settings['REDIS_SLAVE_HOST']);
define("RD_SLAVE_PORT",$settings['REDIS_SLAVE_PORT']);

define("LINK_PAY_URL",$settings['LINK_PAY_URL']);
/*
$RedisConfig = array();

$RedisConfig['rd_master_host'] = $settings['REDIS_MASTER_HOST'];
$RedisConfig['rd_master_port'] = $settings['REDIS_MASTER_PORT'];
$RedisConfig['rd_slave_host']  = $settings['REDIS_SLAVE_HOST'];
$RedisConfig['rd_slave_port']  = $settings['REDIS_SLAVE_PORT'];
*/
?>